/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pgpproj.pgpframework.Message;

import java.io.IOException;
import java.security.PublicKey;
import java.util.logging.Level;
import java.util.logging.Logger;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;

/**
 *
 * @author guest-O5P4nY
 */
public class PGPAuthMessage {

    private String msg;
    private String msgHash;
    private String assinatura;

    public PGPAuthMessage(String msg, String msgHash, byte[] assinatura) {
        this.msg = msg;
        this.msgHash = msgHash;
        this.assinatura =  new BASE64Encoder().encode(assinatura);
        System.out.println("assinatura em Base64 : " +  assinatura);
        System.out.println("hash da mensagem : " +  msgHash);
        
        
    }

    public byte[] getAssinatura() {
        byte[] result = null;
        try {
            result = new BASE64Decoder().decodeBuffer(assinatura);
        } catch (IOException ex) {
            Logger.getLogger(PGPAuthMessage.class.getName()).log(Level.SEVERE, null, ex);
        }
       return result;
    }


    public String getMsg() {
        return msg;
    }


    public String getMsgHash() {
        return msgHash;
    }



}